Skip to content

Conversation

@himanshu7895
Copy link
Contributor

Generates a structured approval matrix by traversing a user’s managerial chain for the specified number of levels (e.g., their manager, manager’s manager, etc.).
This avoids hardcoding approval paths — making approvals dynamic and maintainable.

⚙️ Inputs
Name Type Description
user_sys_id String Sys ID of the starting user
levels Integer Number of manager levels to retrieve (e.g., 3 = manager → director → VP)

🧾 Output
Name Type Description
approval_matrix JSON Array of { level, approver_sys_id, approver_name, approver_email }

Scenario:
A flow runs when an “Expense Request” is submitted.
Instead of assigning approvals manually, this Flow Action:

Takes the requester’s Sys ID.

Retrieves their manager hierarchy up to 3 levels.

Dynamically generates approvals (e.g., Manager → Department Head → Director).

Flow setup example:

Trigger: New Expense Request submitted.

Action: Generate Approval Matrix (input: current.user.sys_id, levels = 3).

Loop: For each approver in matrix → Create approval record.

Result: Fully dynamic, hierarchy-based approval flow.

🧩 Key Benefits

🔁 No hardcoding — adapts to real org chart changes.

🧱 Reusable across multiple approval workflows.

🧮 Supports configurable depth (1–N levels).

🧼 Self-contained — no external tables or integrations.

@github-actions
Copy link

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@himanshu7895 himanshu7895 marked this pull request as ready for review October 22, 2025 05:39
@github-actions
Copy link

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@ravichandra1998g ravichandra1998g self-assigned this Oct 22, 2025
@ravichandra1998g
Copy link
Contributor

This still doesn't have an error evaluation step as requested in #205.

Add an error evaluation step to handle if the script step fails

Please reopen/submit a new PR after making the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants